/**
* Copyright (c) 2007,中企动力华南研发中心
* All rights reserved.
*/

package com.ce.pms.custservice.dao;

import static org.junit.Assert.assertNotNull;
import junit.framework.Assert;

import org.junit.Test;

import com.ce.pms.DBUnitTool;
import com.ce.pms.custservice.model.SignReadingRecordDO;

/**
 * @author 高嵩 编写日期:2008-12-18
 *	阅签Dao测试类
 */
public class SignReadingDaoImplT extends DBUnitTool{

	private ISignReadingDao  signReadingDao=  null;
	/* (non-Javadoc)
	 * @see com.ce.pms.DBUnitTool#setUp()
	 */
	@Override
	public void setUp() throws Exception {
		// TODO Auto-generated method stub
		super.setUp();
		initCustServiceEventDao();
	}

	private void initCustServiceEventDao(){
		if (this.signReadingDao==null) {
			this.signReadingDao = (ISignReadingDao)this.applicationContext.getBean("signReadingDao");
		}
		assertNotNull(signReadingDao);
	}

	/* (non-Javadoc)
	 * @see com.ce.pms.DBUnitTool#tearDown()
	 */
	@Override
	public void tearDown() throws Exception {
		// TODO Auto-generated method stub
		super.tearDown();
		signReadingDao =  null;
	}

	 /**
	  * 功能描述:  测试根据事件ID查询阅签<br>
	  * Create author:高嵩 <br>
	  * Create on:2008-12-23  <br>
	  * Edit author:  <br>
	  * Edit on:    <br>
	  * Why:     <br>
	  */
	@Test
	 public void getSignReadingByID(){
		Long csEventID=1L;
		SignReadingRecordDO signReadingRecordDO =signReadingDao.getSignReadingByID(csEventID);
		Assert.assertNotNull(signReadingRecordDO);
		Assert.assertEquals(signReadingRecordDO.getCreator(), new Long(22));
		Assert.assertEquals(signReadingRecordDO.getReviewer(),"刘爱月");
	 }
}
